const {
  defineConfig
} = require('@vue/cli-service')
const { VantResolver } = require('unplugin-vue-components/resolvers');
const ComponentsPlugin = require('unplugin-vue-components/webpack');
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
      port: 7777,
      proxy: {
          "/api": {
              target: "https://api.iynn.cn/film/api/v1",
              changeOrigin: true,
              pathRewrite: {
                  "^/api": "",
              },
          },
          "/front": {
              target: 'http://localhost:7779/front/api/user',
              changeOrigin: true,
              pathRewrite: {
                  "^/front": "",
              },
          }
      },
  },
  configureWebpack: {
    plugins: [
      ComponentsPlugin({
        resolvers: [VantResolver()],
      }),
    ],
  },
})